#include "gx_threadpool.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

void * f(void * arg)
{
	printf("thread:%lu,arg:%d\n",pthread_self(),(int)arg);
	system("ls -l");
	sleep(1);
	return NULL;
}

#define times 10

int main(void)
{
	THREAD_POOL * thpool = threadpool_init(10);
	for(int i=0;i<times;i++)
		threadpool_add(thpool,f,(void*)i);
	sleep(5);
	threadpool_destroy(thpool);
	
	/*
	while(1)
	{
	}
	*/
	
}
